package com.example.config;

import com.example.interceptor.AuthorizInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author AiXu
 * @version v1.0
 * @since 2023/9/12 21:30
 */

@Configuration
public class WebConfiguration implements WebMvcConfigurer {

    @Resource
    AuthorizInterceptor authorizInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authorizInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/api/auth/**");
    }
}
